import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../views/Home.vue";
import Docs from "../views/Docs.vue";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "Home",
    component: Home
  },
  {
    path: "/docs",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: Docs,
    children: [
      {
        path: "",
        redirect: "intro"
      },
      {
        path: "intro",
        component: () =>
          import(/* webpackChunkName: "about" */ "../views/docs/Intro.vue")
      }
    ]
  }
];

const router = new VueRouter({
  routes
});

export default router;
